////////////////////////////////////////////////////////////////////////////
//
// Copyright 2018 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

@import "~realm-studio-styles/variables";

@keyframes fade {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.LoadingOverlay {
  align-items: center;
  animation-delay: 0s;
  animation-duration: .33s;
  animation-fill-mode: forwards;
  animation-name: fade;
  background: $overlay-background;
  bottom: 0;
  left: 0;
  opacity: 0;
  overflow: auto;
  padding: 2 * $spacer;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 100;

  &--no-fade {
    animation-delay: 0s;
    animation-duration: 0s;
    opacity: 1;
  }

  &__Content {
    align-items: center;
    color: $dove;
    display: flex;
    flex-direction: column;
    font-size: .9rem;
    justify-content: center;
    min-height: 100%;
    width: 100%;
  }

  &__Progress {
    margin: $spacer;
    width: 60vw;
  }

  &__Failure,
  &__Message {
    align-items: center;
    display: flex;
    flex-direction: column;
    text-align: center;
    white-space: pre-line;
    width: 80%;
  }

  &__Failure {
    flex-shrink: 0;
    font-size: 3em;
    margin: $spacer;
    margin-bottom: 0;
  }

  &__Message {
    padding: $spacer;
  }

  &__RetryButton {
    margin-top: $spacer;
  }
}
